package com.atguigu.jxc.controller;
import com.atguigu.jxc.domain.ServiceVO;
import com.atguigu.jxc.entity.CustomerReturnList;
import com.atguigu.jxc.entity.ReturnList;
import com.atguigu.jxc.service.CustomerReturnListGoodsService;
import com.atguigu.jxc.service.ReturnListGoodsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * @description 供应商Controller控制器
 */
@RestController
@RequestMapping("/customerReturnListGoods")
public class CustomerReturnListGoodsController {

	@Autowired
	private CustomerReturnListGoodsService customerReturnListGoodsService;

	/**
	 * 下拉查询供应商
	 *
	 * @return
	 */
	@RequestMapping("/save")
    //    @RequiresPermissions(value = "供应商管理")
	public ServiceVO getComboboxList(CustomerReturnList customerReturnList, String customerReturnListGoodsStr) {
		return customerReturnListGoodsService.save(customerReturnList, customerReturnListGoodsStr);
	}

	@RequestMapping("/list")
	//    @RequiresPermissions(value = "供应商管理")
	public Map<String, Object> list(String purchaseNumber, Integer supplierId, Integer state, String sTime, String eTime) {
		return customerReturnListGoodsService.list(purchaseNumber, supplierId, state, sTime, eTime);
	}

	@RequestMapping("/goodsList")
	//    @RequiresPermissions(value = "供应商管理")
	public Map<String, Object> goodsList(Integer customerReturnListId) {
		return customerReturnListGoodsService.goodsList(customerReturnListId);
	}

	@RequestMapping("/delete")
	//    @RequiresPermissions(value = "供应商管理")
	public ServiceVO delete(Integer customerReturnListId) {
		return customerReturnListGoodsService.delete(customerReturnListId);
	}


	@RequestMapping("/updateState")
	//    @RequiresPermissions(value = "供应商管理")
	public ServiceVO updateState(Integer customerReturnListId) {
		return customerReturnListGoodsService.updateState(customerReturnListId);
	}


	@RequestMapping("/count")
	//    @RequiresPermissions(value = "供应商管理")
	public String count(String sTime, String eTime ,Integer goodsTypeId, String codeOrName){
		return customerReturnListGoodsService.count(sTime, eTime, goodsTypeId, codeOrName);
	}

}
